using System;

using MettleSystems.dashCommerce.Core;
using OpenNetCommerce.Localization;
using MettleSystems.dashCommerce.Store;

namespace MettleSystems.dashCommerce.Web.controls.navigation {
  public partial class review : System.Web.UI.UserControl {

    #region Member Variables

    private Product product;
    public Product Product {
      get {
        return product;
      }
      set {
        product = value;
      }
    }

    #endregion

    #region Page Events

    /// <summary>
    /// Handles the Load event of the Page control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
    protected void Page_Load(object sender, EventArgs e) {
      try {
        if (product != null) {
          hlReview.NavigateUrl = string.Format("~/review.aspx?pid={0}{1}", product.ProductId, "&KeepThis=true&TB_iframe=true&height=450&width=400");
          hlReview.ToolTip = string.Format(LocalizationUtility.GetText("titleReview"), product.Name.PadRight(30).Substring(0, 30).Trim());
        }
      }
      catch (Exception ex) {
        Logger.Error(typeof(review).Name + "Page_Load", ex);
      }
    }

    #endregion

  }
}